<template>
	<view class="mine-container" >
		<!--顶部个人信息栏-->

			<view>
				<view v-for="(item, index) in tableData" :key="index">
					<uni-card :title="item.projectName"  :extra="item.status" class="card">
						<view class="card-second">
							<view class="card-left">
								<text >项目经理: {{item.projectManagerName}} </text>
							</view>
							
							<view class="card-right">
								<text >加入时间: {{item.joinTime}} </text>
							</view>
						</view>
					</uni-card>
				</view>

			</view>

		</view>
	</view>
</template>

<script>
	import storage from '@/utils/storage'
	import moment from 'moment'
	import {
		getMyActorProject,
		getMyProjectAllList,
		getMyProjectAllStatus
	} from "@/api/mhour/project";
	
	export default {
		data() {
			return {
				name: this.$store.state.user.name,
				//version: getApp().globalData.config.appInfo.version,
				tableData: [],
				queryParams: {
				        pageNum: 1,
				        pageSize: 10,
				      },
					  total:0,
			}
		},
		onLoad() {
			this.init();
		},
		computed: {
			avatar() {
				return this.$store.state.user.avatar
			},
			windowHeight() {
				return uni.getSystemInfoSync().windowHeight - 50
			}
		},
		methods: {
			init() {
				 getMyProjectAllList(this.queryParams).then(
				        res => {
				          // console.log(res);
				          if (res.code == 200) {
				            // this.$message.success(res.msg);
				            this.total = res.data.total;
				            this.tableData = res.data.rows;
							
							 this.tableData.forEach(item=>{
								if (item.projectStatus == 'a') {
									item.status = "进行中"
								} else if (item.projectStatus == 'b') {
									item.status = "运维中"
								} else if (item.projectStatus == 'c') {
									item.status = "已结束"
								}
								
							 });
							
				          } else {
							  this.$modal.msgError("出现错误，错误信息为：",res.data.msg)
				          }
				        }
				      );
			},

		}
	}
</script>

<style lang="scss">
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #fff;
		min-height: 100%;
		height: auto;
	}
	
	view {
		font-size: 14px;
		line-height: inherit;
	}

	.mine-container {
		width: 100%;
		height: 100%;


		.header-section {
			padding: 15px 15px 45px 15px;
			background-color: #3c96f3;
			color: white;

			.login-tip {
				font-size: 18px;
				margin-left: 10px;
			}

			.cu-avatar {
				border: 2px solid #eaeaea;

				.icon {
					font-size: 40px;
				}
			}

			.user-info {
				margin-left: 15px;

				.u_title {
					font-size: 18px;
					line-height: 30px;
				}
			}
		}

		.content-section {
			position: relative;
			top: 0px;

			.mine-actions {
				margin: 15px 15px;
				padding: 20px 0px;
				border-radius: 8px;
				background-color: white;

				.action-item {
					.icon {
						font-size: 28px;
					}

					.text {
						display: block;
						font-size: 13px;
						margin: 8px 0px;
					}
				}
			}
		}
	}

	.swiper {
		height: 300rpx;
	}

	.swiper-box {
		height: 150px;
	}

	@media screen and (min-width: 500px) {
		.uni-swiper-dot-box {
			width: 400px;
			/* #ifndef APP-NVUE */
			margin: 0 auto;
			/* #endif */
			margin-top: 8px;
		}

		.image {
			width: 100%;
		}
	}

	.card {
		margin: 15px 15px;
		box-sizing: border-box;

	}

	.card-second {
		display: flex;
		border-bottom: 1px #EBEEF5 solid;
		flex-direction: row;
		align-items: center;
		padding: 10px;
		overflow: hidden;
	}

	.card-left {
		flex: 1;

	}

	.card-right {
		.button {
			padding-left: 10px;
			padding-right: 10px;

		}
	}
	.uni-margin-wrap {
		width: 690rpx;
		width: 100%;
	
	}
	
	
</style>